package com.lixh.sdk.base.util

import android.os.Build
import androidx.compose.ui.graphics.Color
import androidx.core.content.ContextCompat

val Int.stringArray
    get() = application.resources.getStringArray(this)

val Int.drawable
    get() = ContextCompat.getDrawable(application, this)

val Int.string
    get() = application.resources.getString(this)

val Int.dimen
    get() = application.resources.getDimension(this)


val Int.color
    get() = if (Build.VERSION.SDK_INT >= 23) {
        Color(application.resources.getColor(this, application.theme))
    } else {
        @Suppress("DEPRECATION")
        Color(application.resources.getColor(this))
    }
